import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        configInfo: null,
        keyword: ''
    },
    getters: {
        configInfo: state => state.configInfo,
        keyword: state => state.keyword
    },
    mutations: {
        SET_CONFIGINFO: (state, configInfo) => {
            state.configInfo = configInfo
        },
        SET_KEYWORD: (state, keyword) => {
            state.keyword = keyword
        }

    },
    actions: {
        setConfigInfo({ commit }, configInfo) {
            commit('SET_CONFIGINFO', configInfo)
        },
        setKeyword({ commit }, keyword) {
            commit('SET_KEYWORD', keyword)
        }
    },
    modules: {}
})